<template>
  <div style="height: 800px;">
    <fm-making-form
      ref="makingform"
      preview
      generate-code
      generate-json
    >
      <template slot="action">
        <el-button
          type="text"
          icon="el-icon-upload"
          @click="saveFormData"
        >
          保存
        </el-button>
      </template>
    </fm-making-form>
  </div>
</template>


<script>
export default {
  name: '',
  created() {
  },
  methods:{
    saveFormData(){
      const data = this.$refs.makingform.getJSON()
      this.$emit('getFormJsonScript',data)
    },
    initWidgetForm(data){
      console.log('data==============', data)
      this.$refs.makingform.setJSON(data)
    }
  }
}
</script>
